<?php

namespace App\Model;

use Illuminate\Database\Eloquent\Model;
use Illuminate\Support\Facades\Config;
use Illuminate\Encryption\Encrypter;
use Illuminate\Support\Facades\Crypt;

class Contato extends Model
{
    public function getbody()
    {
        $iv = pack("H*", "abcdef9876543210abcdef9876543210");
        $key = base64_decode(substr(Config::get('i2p.key'), 7));
        $op = openssl_decrypt($this->body, 'AES-256-CBC', $key, OPENSSL_ZERO_PADDING, $iv);
        return trim($op);

    }
}
